package com.hmy.finance.dal.po.receipt;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hmy.finance.api.common.enums.receipt.AccountTradeBusinessTypeEnum;
import com.hmy.finance.api.common.enums.receipt.AccountTradeTypeEnum;
import lombok.Data;
import org.apache.ibatis.type.EnumTypeHandler;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 客户账户流水记录
 *
 * @TableName customer_contactor_account_trade
 */
@TableName(value = "customer_contactor_account_trade")
@Data
public class CustomerContactorAccountTradePo implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 所属客户主键ID
     */
    @TableField(value = "customer_id")
    private Long customerId;

    /**
     * 所属客户联系人主键ID
     */
    @TableField(value = "customer_contactor_id")
    private Long customerContactorId;

    /**
     * 关联业务单据ID
     */
    @TableField(value = "business_id")
    private Long businessId;

    /**
     * 业务单据类型，收款分摊、自动划账
     */
    @TableField(value = "business_type", typeHandler = EnumTypeHandler.class)
    private AccountTradeBusinessTypeEnum businessType;

    /**
     * 流水金额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 流水类型，收入，支出
     */
    @TableField(value = "trade_type", typeHandler = EnumTypeHandler.class)
    private AccountTradeTypeEnum tradeType;

    /**
     * 费用发生日期
     */
    @TableField(value = "fee_incurred_time")
    private LocalDateTime feeIncurredTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 创建人ID
     */
    @TableField(value = "creator_id")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 更新人ID
     */
    @TableField(value = "updater_id")
    private Long updaterId;

    /**
     * 更新人姓名
     */
    @TableField(value = "updater_name")
    private String updaterName;

    /**
     * 是否删除，0-否；1-是
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}